<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        #root {
            width: 80%;
            max-width: 800px;
            margin: 0 auto;

            & > div > div {
                display: flex;
                margin: 10px 0;
            }

            height: 80px;
        }

        .aBox {
            width: calc(100% - 60% - 60px);
            height: 100px;
            margin-right: 60px;
            border-radius: 5px;
            background: #679aff;
            line-height: 100px;
            text-align: center;
            box-shadow: 0 0 2px 2px #c4c4c4;
            overflow: hidden;
        }

        .bBox {
            width: 60%;
            height: 100px;
            border-radius: 5px;
            background: #ffffff;
            line-height: 100px;
            text-align: center;
            box-shadow: 0 0 2px 2px #c4c4c4;
        }

        textarea {
            width: 100%;
            height: 100%;
            outline: none;
            border: none;
            overflow-y: scroll;
            background: none;
        }
    </style>
</head>
<body>
<div id="root">
    <div>
        <h2>请使用鼠标操作DIV触发事件</h2>
        <div>
            <div class="aBox" id="aBox">DIV</div>
            <div class="bBox" id="bBox"></div>
        </div>
    </div>

    <div>
        <h2>请使用鼠标操作DIV触发事件</h2>
        <div>
            <div class="aBox"><textarea id="cBox"></textarea></div>
            <div class="bBox" id="dBox"></div>
        </div>
    </div>
</div>

<script>
    const aBox = document.getElementById('aBox');
    const bBox = document.getElementById('bBox');
    const cBox = document.getElementById('cBox');
    const dBox = document.getElementById('dBox');
    aBox.addEventListener('dblclick', () => {
        bBox.innerHTML = '您刚刚双击了DIV，触发了dblclick事件';
    })
    cBox.addEventListener('change', () => {
        dBox.innerHTML = '输入框内容改变，触发了onchange';
    })

</script>

</body>
</html>